<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
 <head>
  <title>创建学期</title>
  <t:base type="jquery,easyui,tools,DatePicker"></t:base>
  <script type="text/javascript">
  	$(function(){
  		setSemesterName();
  		$("#year").on('change', function(){
  			setSemesterName();
  		});
  		$("#semester").on('change', function(){
  			setSemesterName();
  		});
  	});
  	function setSemesterName(){
  		var year = $("#year").val();
  		var semester = $("#semester").val();
  		$("#semesterName").val(year + semester);
  	}
  </script>
 </head>
 <body>
  <t:formvalid formid="formobj" dialog="true" beforeSubmit="myCheck" layout="table" action="semesterInfoController.do?doAdd" tiptype="3" >
		<table style="" cellpadding="0" cellspacing="1" class="formtable">
				<tr>
					<td align="right">
						<label class="Validform_label">
							<span style="color:red;font-size: 12px;">*</span>学年:
						</label>
					</td>
					<td class="value">
					     	 <select id="year" name="year" datatype="*" >
					     	   <option>2016</option>
					     	   <option>2017</option>
					     	   <option>2018</option>
					     	   <option>2019</option>
					     	   <option>2020</option>
					     	   <option>2021</option>
					     	   <option>2022</option>
					     	   <option>2023</option>
					     	   <option>2024</option>
					     	   <option>2025</option>
					     	   <option>2026</option>
					     	 </select>
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">学年</label>
					</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							<span style="color:red;font-size: 12px;">*</span>学期:
						</label>
					</td>
					<td class="value">
					     	<select id="semester" name="semester" datatype="*" >
					     	   <option value="1">1</option>
					     	   <option value="2">2</option>
					     	   <option value="3">3</option>
					     	 </select>
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">学期</label>
						</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							开始日期:
						</label>
					</td>
					<td class="value">
					     	<input id="startDate"  datatype="*" name="startDate" type="text" style="width: 150px" class="inputxt" onClick="WdatePicker()">
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">开始日期</label>
						</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							结束日期:
						</label>
					</td>
					<td class="value">
					     	<input id="endDate" name="endDate"  datatype="*" type="text" style="width: 150px" class="inputxt" onClick="WdatePicker()">
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">结束日期</label>
						</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							学期名称:
						</label>
					</td>
					<td class="value">
					     	 <input id="semesterName" readonly="readonly" name="semesterName" type="text" style="width: 150px" maxlength="80"
					     	 class="inputxt" onkeypress="specialTextValidate()">
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">学期名称</label>
						</td>
				</tr>
			</table>
		</t:formvalid>
 </body>
  <script>
  	function myCheck(){
  		var start = $('#startDate').val();
  		var end = $('#endDate').val();
  		if(start != '' && end != ''){
  			if(start >end ){
  				tip('开始日期不能大于结束日期');
  				return false;
  			}
  		} 

  		return true;
  	}
  </script>		
